import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import '../../../../resource/language/generated/l10n.dart';
import 'doufeng_tacit_model.dart';

class StopTacitWidget extends StatefulWidget {
  // VoidCallback onEnd;
  // VoidCallback onCancel;
  //
  // InvitingRefuseWidget();

  @override
  State<StopTacitWidget> createState() => _StopTacitWidgetState();
}

class _StopTacitWidgetState extends State<StopTacitWidget>
    with TickerProviderStateMixin {
  @override
  Widget build(BuildContext context) {
    return Consumer<DoufengTacitModel>(builder: (context, model, child) {
      return Container(
        padding: const EdgeInsets.symmetric(
          horizontal: 0,
        ),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            const SizedBox(
              height: 30,
            ),
            Text(
              T.current.tips,
              style: const TextStyle(
                fontSize: 16,
                fontWeight: FontWeight.w500,
                color: Colors.white,
              ),
            ),
            const SizedBox(height: 39),
            const Text(
              "默契值测验还没有结束哦~确定要退出吗？",
              style: TextStyle(
                fontSize: 14,
                fontWeight: FontWeight.w500,
                color: Colors.white,
              ),
              textAlign: TextAlign.center,
            ),
            const SizedBox(
              height: 20,
            ),
            Row(
              // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: [
                CupertinoButton(
                  onPressed: () {
                    // DoufengTacitModel.tacitResponse(
                    //     context, false, model.roomModel.channel!.channelId);

                    /// 关闭定时器
                    model.cancelTimer();
                    Navigator.pop(context);
                  },
                  child: Container(
                    width: 112,
                    height: 36,
                    decoration: BoxDecoration(
                      border:
                          Border.all(color: const Color(0xFF4B3593), width: 1),
                      borderRadius: BorderRadius.circular(18),
                    ),
                    alignment: Alignment.center,
                    child: const Text(
                      "残忍退出",
                      style: TextStyle(
                        color: Color(0xFF8F5CFF),
                        fontSize: 14,
                        fontWeight: FontWeight.w500,
                      ),
                    ),
                  ),
                ),
                CupertinoButton(
                  onPressed: () {
                    Navigator.pop(context);
                  },
                  child: Container(
                    width: 112,
                    height: 36,
                    decoration: BoxDecoration(
                      gradient: const LinearGradient(
                        colors: [Color(0xFFEC6FA9), Color((0xFFEA3B7B))],
                      ),
                      borderRadius: BorderRadius.circular(18),
                    ),
                    alignment: Alignment.center,
                    child: const Text(
                      "继续答题",
                      style: TextStyle(
                        color: Colors.white,
                        fontSize: 14,
                        fontWeight: FontWeight.w500,
                      ),
                    ),
                  ),
                ),
              ],
            ),
          ],
        ),
      );
    });
  }
}
